
// ECharts绘制对象
var option = null;

//颜色
const color = ["#00FFFF", "#CC0033", "#99CC33"];

/**
 * 封装数据
 */
function getOption(noOutlierJson, isOutlierJson, noOutlierJson2) {
    // 样例值
    var res = [];
    var res1 = [
        [112.1000, 32.60335],[112.1169, 32.7076],
        [112.1369, 32.7076],[112.11888, 32.5626],
        [112.11888, 32.6726],[112.0409, 32.7434]
    ];
    var res2 = [];

    if(noOutlierJson !== null && noOutlierJson !== undefined) {
        res = [];
        res = JSON.parse(noOutlierJson);
    }
    if(isOutlierJson !== null && isOutlierJson !== undefined) {
        res1 = [];
        res1 = JSON.parse(isOutlierJson);
    }
    if(noOutlierJson2 !== null && noOutlierJson2 !== undefined) {
        res2 = [];
        res2 = JSON.parse(noOutlierJson2)
    }

    option = {
        baseOption: {
            bmap: bmap,

            geo: {
                map: 'bmap',
                roam:true
            },

            series: [
                {
                    type: 'lines',
                    coordinateSystem: 'bmap',
                    data: res,
                    lineStyle: {
                        normal: {
                            color: color[0],
                            width: 2,
                            opacity: 0.8, //图形透明度。支持从 0 到 1 的数字，为 0 时不绘制该图形。
                            curveness: 0.1 //边的曲度，支持从 0 到 1 的值，值越大曲度越大
                        }
                    }
                },
                {
                    type: 'scatter',
                    coordinateSystem: 'bmap',
                    data: res1,
                    itemStyle: {
                        normal: {
                            color: color[1]
                        }
                    }
                },
                {
                    type: 'scatter',
                    coordinateSystem: 'bmap',
                    data: res2,
                    itemStyle: {
                        normal: {
                            color: color[2]
                        }
                    }
                }
            ]
        }
    };

    return this.option;
}
